//
//  CurrentDeputeTableViewCell.m
//  bitcoin
//
//  Created by  旺链 on 2018/5/28.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "CurrentDeputeTableViewCell.h"

@implementation CurrentDeputeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)unDoClick:(id)sender {
    
    if (self.unDoBack) {
        self.unDoBack();
    }
}
-(void)configWidthData:(NSDictionary*)data
{
    self.timeLb.text = data[@"createTime"];
    self.titleLb.text = data[@"currencyRelation"];
    self.typeLb.text = data[@"businessType"];
    self.priceLb.text = data[@"price"];
    self.numLb.text = data[@"orderAmount"];
    self.countLb.text = data[@"total"];
    
    if ([data[@"businessTypeStatus"]integerValue] == 1) {
        //买入
        self.typeLb.textColor = [UIColor colorWithHexString:@"#2CB25A"];
    }else{
        
        self.typeLb.textColor = [UIColor colorWithHexString:@"#E1454F"];
    }
    
    NSString *relation =data[@"currencyRelation"];
    NSArray *arr = [relation componentsSeparatedByString:@"/"];
    NSString *trade = arr[0];
    NSString *pay = arr[1];
    
    self.priceTittle.text = [NSString stringWithFormat:@"价格(%@)",pay];
    self.doneTittle.text = [NSString stringWithFormat:@"已成交(%@)",trade];
}
@end
